package com.it.system.adservice.controller;


import com.it.system.adservice.entity.PromotionAd;
import com.it.system.adservice.service.PromotionAdService;
import jakarta.annotation.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ad")
public class PromotionAdController {

    @Resource
    private PromotionAdService promotionAdService;
    @GetMapping("/getAdsBySpaceId/{sid}")
    public ResponseEntity<List<PromotionAd>> getAdsBySpaceId(@PathVariable Integer sid)
    {
       List<PromotionAd> ads=promotionAdService.getAdsBySpaceId(sid);
       return ResponseEntity.ok(ads);
    }



}
